package team.knowers.tourist.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import team.knowers.tourist.common.convention.result.Result;
import team.knowers.tourist.common.convention.result.Results;
import team.knowers.tourist.dao.entity.TouristDO;
import team.knowers.tourist.dto.req.TouristLoginReqDTO;
import team.knowers.tourist.dto.req.TouristRegisterReqDTO;
import team.knowers.tourist.service.TouristService;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class TouristController {
    private final TouristService touristService;

    @PostMapping("/api/tourist/register")
    public Result<Void> register(@RequestBody TouristRegisterReqDTO touristRegisterReqDTO) {
        touristService.register(touristRegisterReqDTO);
        return Results.success();
    }
    @PostMapping("/api/tourist/login")
    public Result<TouristDO> login(@RequestBody TouristLoginReqDTO touristLoginReqDTO) {
        return Results.success(touristService.login(touristLoginReqDTO));
    }

}
